import Vue from 'vue'
import router from 'vue-router'
import Main from '../views/Main'
import Login from '../views/Login'
import UserList from '../views/user/List'
import UserProfile from '../views/user/profile'
import UserReward from '../views/user/reward'
import NotFoundPage from '../views/NotFound'
import changePwd from '../views/user/changePwd'
import UserRewards from '../views/user/rewards'
import UserGpa from '../views/user/gpa'
import UserDaily from '../views/user/daily'
import ScienceQuery from '../views/user/science/sciencequery'
import ScheduleQuery from '../views/user/schedule/schedulequery'
import Work from '../views/user/work/work'
import Party from '../views/user/party/party'
import PracticeAdd from '../views/user/practice/practiceadd'
import Practice from '../views/user/practice/practice'

import AdMain from '../views/AdMain'
import CPwd from '../views/Administrator/AdChangePwd'
import SInfoManage from '../views/Administrator/SInfo/SInfoManage'
import SInfoAdd from '../views/Administrator/SInfo/SInfoAdd'


Vue.use(router);
export default new router({
  mode: 'history',
  routes:[
    {
      path:'/main/:username',
      component:Main,
      props: true,
      children:[
        {
          //:id定义参数名称
          path:'/user/profile/:id',
          name:'UserProfile',
          component:UserProfile,
          props: true
        },
        {
          //:id定义参数名称
          path:'/user/reward/:id',
          name:'UserReward',
          component:UserReward,
          props: true,
        },
        {
          //:id定义参数名称
          path:'/user/gpa/:id',
          name:'UserGpa',
          component:UserGpa,
          props: true,
        },
        {
          //:id定义参数名称
          path:'/user/daily/:id',
          name:'UserDaily',
          component:UserDaily,
          props: true,
        },
        {
          //:id定义参数名称
          path:'/science/sciencequery/:id',
          name:'ScienceQuery',
          component:ScienceQuery,
          props: true,
        },
        {
          //:id定义参数名称
          path:'/schedule/schedulequery/:id',
          name:'ScheduleQuery',
          component:ScheduleQuery,
          props: true,
        },
        {
          //:id定义参数名称
          path:'/work/work/:id',
          name:'Work',
          component:Work,
          props: true,
        },
        {
          //:id定义参数名称
          path:'/work/work/:id',
          name:'Work',
          component:Work,
          props: true,
        },
        {
          //:id定义参数名称
          path:'/party/party/:id',
          name:'Party',
          component:Party,
          props: true,
        },
        {
          //:id定义参数名称
          path:'/practice/practiceadd/:id',
          name:'PracticeAdd',
          component:PracticeAdd,
          props: true,
        },
        {
          //:id定义参数名称
          path:'/practice/practice/:id',
          name:'Practice',
          component:Practice,
          props: true,
        },
        {
          path:'/user/list',
          name:'UserList',
          component:UserList
        },
        {
          path:'/changePwd/:id',
          name:'changePwd',
          component:changePwd,
          props: true
        }
      ]
    },
    {
      path:'/admain/:username',
      component:AdMain,
      props: true,
      children:[
        {
          path:'/Ad/SInfoM/:id',
          name:'SInfoManage',
          component:SInfoManage,
          props: true
        },
        {
          path:'/Ad/SInfoA/:id',
          name:'SInfoAdd',
          component:SInfoAdd,
          props: true
        },
        {
          path:'/CPwd/:id',
          name:'CPwd',
          component:CPwd,
          props: true
        }
      ]
    },
    {
      path:'/login',
      component:Login
    },
    {
      path: '/',
      redirect: '/login'
    },
    {
      path:'*',
      component:NotFoundPage
    },
    {
      //:id定义参数名称
      path:'/user/rewards/:id',
      name:'UserRewards',
      component:UserRewards,
      props: true
    }
  ]
});
